//
//  JGPViewController.m
//  tianyue
//
//  Created by ZhengYing on 2017/7/7.
//  Copyright © 2017年 zy. All rights reserved.
//

#import "JGPViewController.h"

@interface JGPViewController ()
@property (weak, nonatomic) IBOutlet UIImageView *imageView;

@end

@implementation JGPViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}
- (IBAction)lh:(id)sender {
    [self.imageView setImage:[UIImage imageNamed:@"jg_1"]];
}
- (IBAction)ddsp:(id)sender {
    [self setBtnShow:2];
    [self.imageView setImage:[UIImage imageNamed:@"jg_2"]];

}
- (IBAction)ytjg:(id)sender {
    [self setBtnShow:3];

    [self.imageView setImage:[UIImage imageNamed:@"jg_3"]];

}
- (IBAction)jgdx:(id)sender {
    [self setBtnShow:4];

    [self.imageView setImage:[UIImage imageNamed:@"jg_4"]];

}

-(void)setBtnShow:(int)index{
    for (UIButton  *btn in self.view.subviews) {
        if (btn.tag>index*100&&btn.tag<(index+1)*100) {
            btn.hidden = NO;
        }else{
            if (btn.tag>100) {
                btn.hidden = YES;
            }
        }
    }
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    if ([segue.destinationViewController isKindOfClass:[DDRotateViewController class]]) {
        UIButton *btn = (UIButton *)sender;
        NSString *path = @"";
        if (btn.tag==201) {
            path = @"skin/ddsp/dd1#";
        }else{
            path = @"skin/ddsp/dd5#";

        }
        ((DDRotateViewController *)segue.destinationViewController).path= path;

    }
}


@end
